<?php


namespace app\api\validate;


class Cart extends BaseValidate
{
    protected $rule = [
        'flag' => 'integer',
        'product_id' => 'require|isPositiveInt',
        'sku_id' => 'require|isPositiveInt',
        'num' => 'require|isPositiveInt'
    ];

    protected $message = [
        'product_id' => 'product_id参数必须是正整数',
        'sku_id' => 'sku_id参数必须是正整数',
        'num' => 'num参数必须是正整数',
    ];

    protected $scene = [
        'add'=>['flag', 'product_id', 'sku_id', 'num'],
        'del'=>['flag', 'product_id', 'sku_id'],
        'update'=>['flag', 'product_id', 'sku_id', 'num']
    ];
}